package com.xiaolin.designmode.chain_of_responsibility;

/**
 * @ClassName ConcreteHandler2
 * @Description 具体请求者2，是处理请求者1的后续请求者
 * @Detail detail
 * @Author MyPC
 * @Date 2020/11/6
 * @Version 1.0
 */
public class ConcreteHandler2 extends Handler {

    @Override
    public void handleRequest(String req) {
        if(req.equals("two")){
            System.out.println("处理请求2");
        }else if(getNext() !=null){
            getNext().handleRequest(req);
        }else {
            System.out.println("没人处理请求");
        }
    }
}
